<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%
    String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="prjFlowAuthCtrl_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">
        <div class="fieldBox col_50">
            <div class="label">被控制人</div>
            <div class="field">
                <input type="text" id="passiveCtrlId" name="passiveCtrlId" class="ui-textbox" value="${passiveCtrlUsrNm}"/>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">控制内容</div>
            <div class="field">
                <input type="text" id="ctrlContent" name="ctrlContent" data-value="${prjFlowAuthCtrlVO.ctrlContent}"
                       placeholder="请选择" ltype="combobox"/>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">控制项目类型</div>
            <div class="field">
                <input type="text" id="ctrlPrjTypCd" name="ctrlPrjTypCd" data-value="${prjFlowAuthCtrlVO.ctrlPrjTypCd}"
                       placeholder="请选择" ltype="combobox"/>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">添加原因</div>
            <div class="field">
                <input type="text" id="ctrlReason" name="ctrlReason" data-value="${prjFlowAuthCtrlVO.ctrlReason}"
                       placeholder="请选择" ltype="combobox"/>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">发送至录单员</div>
            <div class="field">
                <select name="isAllowSendToRecoder" id="isAllowSendToRecoder" data-value="${prjFlowAuthCtrlVO.isAllowSendToRecoder}">
                    <option value="1">允许</option>
                    <option value="0">禁止</option>
                </select>
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">控制时间</div>
            <div class="field">
                <input name="ctrlStartDt" id="ctrlStartDt" type="text" class="ui-textbox" value="${ctrlStartDtVO}"
                       validate="{required:true}" readonly="readonly">
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">控制结束时间</div>
            <div class="field">
                <input name="ctrlEndDt" id="ctrlEndDt" type="text" class="ui-textbox" value="${ctrlEndDtVO}"
                       validate="{required:true}" readonly="readonly">
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">添加时间</div>
            <div class="field">
                <input name="crtTm" id="crtTm" type="text" class="ui-textbox" value="${crtTm}" readonly="readonly">
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">添加人</div>
            <div class="field">
                <input name="crtUsrNm" id="crtUsrNm" type="text" class="ui-textbox" value="${currentUserName}" readonly="readonly">
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">备注</div>
            <div class="field">
                <textarea name="ctrlRem" id="ctrlRem" rows="7" class="l-textarea" value="${prjFlowAuthCtrlVO.ctrlRem}"
                          style="width:99%" readonly="readonly">${prjFlowAuthCtrlVO.ctrlRem}</textarea>
            </div>
        </div>
    </div>
</form>
<script>
    $(function () {
        //控制内容下拉框
        var _ctrlContentJSON = ${ctrlContentJSON};
        $("#ctrlContent").ligerComboBox({
            isShowCheckBox: true, isMultiSelect: true,
            data: _ctrlContentJSON,
            valueField: 'key',
            textField: 'value'
        });
        //控制项目类型下拉框
        var _projectTypeJSON = ${projectTypeJSON};
        $("#ctrlPrjTypCd").ligerComboBox({
            isShowCheckBox: true, isMultiSelect: true,
            data: _projectTypeJSON,
            valueField: 'key',
            textField: 'value'
        });
        //添加原因下拉框
        var _ctrlReasonJSON = ${ctrlReasonJSON};
        $("#ctrlReason").ligerComboBox({
            isShowCheckBox: true, isMultiSelect: true,
            data: _ctrlReasonJSON,
            valueField: 'key',
            textField: 'value'
        });
        //初始化表单
        $("#prjFlowAuthCtrl_form").ligerForm();
        disabledInput();
    });

    frameElement.dialog.onCancel = function () {
        frameElement.dialog.close();
    }

    function disabledInput() {
        if (liger.get("passiveCtrlId")) {
            liger.get("passiveCtrlId").setDisabled();
        }
        if (liger.get("ctrlContent")) {
            liger.get("ctrlContent").setDisabled();
        }
        if (liger.get("ctrlPrjTypCd")) {
            liger.get("ctrlPrjTypCd").setDisabled();
        }
        if (liger.get("ctrlReason")) {
            liger.get("ctrlReason").setDisabled();
        }
        if (liger.get("isAllowSendToRecoder")) {
            liger.get("isAllowSendToRecoder").setDisabled();
        }
    }
</script>
</body>
</html>